<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>主页</title>
<link rel="stylesheet" href="webjars/easyui-186/1.8.6/themes/gray/easyui.css">
<link rel="stylesheet" href="webjars/easyui-186/1.8.6/themes/icon.css">
<link rel="stylesheet" href="static/custom.css">
<script type="text/javascript" src="webjars/easyui-186/1.8.6/jquery.min.js"></script>
<script type="text/javascript" src="webjars/easyui-186/1.8.6/jquery.easyui.min.js"></script>
<script type="text/javascript" src="webjars/easyui-186/1.8.6/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="static/custom.js"></script>
<style type="text/css">
body {
	margin: 0;
	padding: 0;
}

.north{
		display:flex;
		flex-direction:row;
		justy-items:center;
		justify-content:space-between;
		height:50px;
		background:#FFFFFF;
		font-size: 11px;
		padding: 2px;
	}
</style>
<script type="text/javascript">
	function showTab(container, title, src) {
		var tabContainer = $(container);
		if (tabContainer.tabs('exists', title)) {
			var tab = tabContainer.tabs('getTab', title); // 获取选中的选项卡
			var currentTab = tabContainer.tabs('getSelected');
			if (tab == currentTab) {
				tab.panel('refresh', src);
			} else {
				tabContainer.tabs('select', title); //将选中的tab设为当前tab
			}
		} else {
			tabContainer.tabs('add', {
				'title' : title,
				'href' : src,
				'closable' : true,
			});
		}
	}
	
	$(function(){
		$('#tabContainer').tabs({
			fit:true
		});
		
		$("#menu .easyui-tree").tree({
			onBeforeSelect: function(node){
				   $('#menu div.tree-node-selected').removeClass('tree-node-selected');
				},
			onClick : function(node) {
				if (node.text != undefined && node.href != undefined) {
					showTab('#tabContainer', node.title ? node.title : node.text, node.href);
				}
			}
		});
	});
    function xgmm(){
		var dialog = $('#myDialog');
		dialog.dialog({						
			title:'修改密码',
			width: 300,
			height:400,
			closed: false,
			maximizable:true,
			collapsible:true,
			href: 'password/xg',
			buttons:[
				{iconCls: 'icon-save',
					text: '保存',
					handler: function() {
						var dialog = $.dialog.me(this); //取对话框
						var saveUrl = "password/xg"; 
						var form = $.dialog.form(this); 
						var forms=form[0];
						var pwd1=forms.password1.value;
						var pwd2=forms.password2.value;
						var pwd3=forms.password3.value;
						var params=form.serialize();
						if (pwd1.length == null) {
							$.messager.alert('提示','密码不能为空');
							return;
						}
					if(pwd2!=pwd3){
						$.messager.alert('提示','两次密码不同');
						return ;
						
					}	
					if (pwd2.length == null) {
						$.messager.alert('提示','新密码不能为空');
						return;
					}
					if (pwd3.length == null) {
						$.messager.alert('提示','新密码不能为空');
						return;
					}
					$.post('password/save',params,function(data){				
						$.messager.alert('提示','重新输入');
						if(data.msg=="logout"){
							window.location="login?logout";
						}
					})

					}}
				,$.dialog.buttons.close]
		})
	}
	function Refresh() {
			window.location="login?logout";
	}
	
</script>

</head>
<body class="easyui-layout">
	<div class="north" data-options="region:'north'"style="background-image:url('static/images.jpg/timg.gif')">
			
			<h1 style="margin-left:30px;color: #ddd; " >成绩管理</h1>
		<div id="myDialog">
		<button style="color: #ddd;"  id="myDialog" class="easyui-linkbutton"  onclick="JavaScript:xgmm()">修改密码</button>
		</div>	
			<span style="margin-right: 30px;color: #ddd; font-size: 1.2em; padding-right: -1000px">欢迎你：
			<span sec:authentication="principal.name"></span>
			<a style="color: #ddd;" href="logout">注销</a></span>
	</div>
     <div data-options="region:'west',iconCls:'icon-more', title:'操作栏',split:true" style="width:200px;">
		<div id="menu" class="easyui-accordion" fit=true style="width:300px;height:200px;">   
		    <div title="成绩管理"  style="overflow:auto;padding:10px;" data-options="iconCls:'icon-large-chart'">   
				<ul class="easyui-tree">
				
					<li data-options="href:'grade/cjcx'">成绩查询</li>
					<li data-options="href:'grade/bjcjcx'">班级成绩查询</li>
					<li data-options="href:'grade/bjcjlr'">班级录入成绩</li>
					<li data-options="href:'grade/grcjgl'">学生个人成绩录入</li>
					
				</ul>
		    </div>        
		    <div title="系统设置" data-options="iconCls:'icon-large-smartart'" >   
		        <ul class="easyui-tree">
		        	<li data-options="href:'course/manage'">课程管理</li>
		        	<li data-options="href:'banji/manage'">班级管理</li>
					<li data-options="href:'student/manage'">学生管理</li>
		        </ul>    
		    </div>   
		</div>  
    </div>    
    <div class="middle" data-options="region:'south'" style="height:40px;background: #ddd;text-align: center;font-size: 1em;">
    	<span style="color: #666;">1234</span>
    </div>   
    <div data-options="region:'center'" >
		<div id="tabContainer" style="padding: 1px;">
			<div title="首页" style="padding: 30px;font-family: KaiTi;font-size:35px;font-weight:bold" >
			   <h1 >若数据加载不出请刷新重试</h1>
			   <img src="static/images.jpg/timg .jpg" style="height:70%;width: 100%; ">
			</div>
		</div>
    </div>   
</body>
</html>